<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:48:"./application/admin/template/form/attr_index.htm";i:1587037440;s:79:"/Users/wanghaibo/Desktop/www/ejs86/application/admin/template/public/layout.htm";i:1587037440;s:79:"/Users/wanghaibo/Desktop/www/ejs86/application/admin/template/public/footer.htm";i:1587037440;}*/ ?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/public/plugins/layui/css/layui.css?v=<?php echo $version; ?>" media="all">
  <link rel="stylesheet" href="/public/static/admin/css/admin.css?v=<?php echo $version; ?>" media="all">
  <link rel="stylesheet" href="/public/static/admin/css/ey_layui.css?v=<?php echo $version; ?>" media="all">
  <link rel="stylesheet" href="/public/static/admin/font/ali-font/iconfont.css?v=<?php echo $version; ?>" media="all">
  <script type="text/javascript">
    var eyou_basefile = window.location.pathname;
    var module_name = "<?php echo MODULE_NAME; ?>";
    var __root_dir__ = "";
  </script>  
  <script type="text/javascript" src="/public/static/admin/js/jquery.js?v=<?php echo $version; ?>"></script>
  <script type="text/javascript" src="/public/static/admin/js/jquery-ui/jquery-ui.min.js?v=<?php echo $version; ?>"></script>
  <script type="text/javascript" src="/public/plugins/layer-v3.1.0/layer.js?v=<?php echo $version; ?>"></script>
  <script type="text/javascript" src="/public/static/admin/js/jquery.cookie.js?v=<?php echo $version; ?>"></script>
  <script type="text/javascript" src="/public/plugins/laydate/laydate.js?v=<?php echo $version; ?>"></script>
  <script src="/public/plugins/layui/layui.js?v=<?php echo $version; ?>"></script>
  <script src="/public/static/admin/js/global.js?v=<?php echo $version; ?>"></script>
</head>
<body>
  <link rel="stylesheet" href="/public/static/admin/css/page.css" media="all">
  <div class="layui-fluid" id="LAY-component-layer-list">
    <div class="layui-row">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="web-system">
            <div class="layui-tab layui-tab-card">
              <ul class="layui-tab-title">
                  <li><a href="<?php echo url('form/index'); ?>">报名信息管理</a></li>
                  <li class="layui-this"><a href="<?php echo url('Form/attr_index'); ?>">报名表单管理</a></li>
                  <li><a href="<?php echo url('Form/config'); ?>">报名提醒管理</a></li>
              </ul>
              <div class="layui-tab-content" style="padding:10px 0">
                <div class="layui-tab-item layui-show">
                  <div class="layui-row layui-col-space15">
                    <div class="layui-col-md12">
                      <div class="layui-card">
                        <div class="head-oper">
							<div class="baoming-cate fl">
							  <ul>
                                  <?php if(is_array($channel_list) || $channel_list instanceof \think\Collection || $channel_list instanceof \think\Paginator): $i = 0; $__LIST__ = $channel_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                                  <li><a <?php if(\think\Request::instance()->param('channel_id') == $vo['id']): ?>class="cur"<?php endif; ?> href="<?php echo url('Form/attr_index',['channel_id'=>$vo['id']]); ?>"><?php echo $vo['ntitle']; ?></a></li>
                                  <?php endforeach; endif; else: echo "" ;endif; ?>


							  </ul>
							</div>
                            <div class="fr">
                                <?php if(!(empty($form_id) || (($form_id instanceof \think\Collection || $form_id instanceof \think\Paginator ) && $form_id->isEmpty()))): ?>
                                <a href="<?php echo url('Form/index'); ?>" class="layui-btn layui-btn-primary  input-btn-back"><i class="layui-icon layui-icon-left"></i></a>
                                <?php endif; if(is_check_access(CONTROLLER_NAME.'@add') == '1'): ?>
                                <a data-url="<?php echo url('Form/add'); ?>" data-type="Form_add" class="layui-btn mt5 ">新增表单</a>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="layui-card-body" pad15>
                            <div class="layui-form layui-border-box layui-table-view house-table" lay-filter="demo" lay-id="admin-arctype" >
                                <div class="layui-table-box">
                                    <div class="layui-table-body " >
                                        <table cellspacing="0" cellpadding="0" border="0" class="layui-table layui-form" style="width: 100%" lay-skin="line">
                                            <thead >
                                            <tr>
                                                <th class="w40 tc"> <div class="layui-table-cell w40 tc laytable-cell-checkbox">
                                                    <input type="checkbox" lay-filter="checkAll" id="checkAll" lay-skin="primary" >
                                                </th>
                                                <th class="w60 tc"> <div class="layui-table-cell w60 tc" ><span>ID</span></div></th>
                                                <th class="wauto"> <div class="layui-table-cell wauto"><span>表单名称</span></div></th>
                                                <th class="w100 tc"> <div class="layui-table-cell w200 tc"><span>所属模型</span></div></th>
                                                <th class="w100 tc"> <div class="layui-table-cell w100 tc"><span>报名数量</span></div></th>
                                                <th class="w100 tc"> <div class="layui-table-cell w100 tc"><span>字段数量</span></div></th>
                                                <th class="w300 tc"> <div class="layui-table-cell w300 tc"><span>操作</span></div></th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php if(empty($list) || (($list instanceof \think\Collection || $list instanceof \think\Paginator ) && $list->isEmpty())): ?>
                                                <tr>
                                                  <td colspan="6" class="no-data tc">
                                                     没有符合条件的数据
                                                  </td>
                                                </tr>
                                              <?php else: if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): if( count($list)==0 ) : echo "" ;else: foreach($list as $k=>$vo): ?>
                                                <tr>
                                                    <td>
                                                        <div class="layui-table-cell w40 tc laytable-cell-checkbox">
                                                            <input type="checkbox" name="form_ids[]" value="<?php echo $vo['id']; ?>" lay-filter="form_ids" lay-skin="primary">
                                                        </div>
                                                    </td>
                                                    <td><div class="layui-table-cell w60 tc"> <?php echo $vo['id']; ?> </div></td>
                                                    <td><div class="layui-table-cell wauto"><a href="javascript:void(0);" data-url="<?php echo url('Form/index',['form_id'=>$vo['id']]); ?>" class="eju-event" data-type="Form_edit"><?php echo $vo['name']; ?></a></div></td>
                                                    <td>
                                                        <div class="layui-table-cell w200 tc">
                                                            <?php echo $vo['channel_name']; ?>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="layui-table-cell w100 tc">
                                                            <a href="javascript:void(0);" data-url="<?php echo url('Form/index',['form_id'=>$vo['id'],'tabase'=>1]); ?>" class="eju-event blue" data-type="Form_index"><?php echo (isset($form_list_total[$vo['id']]['total']) && ($form_list_total[$vo['id']]['total'] !== '')?$form_list_total[$vo['id']]['total']:'0'); ?></a>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="layui-table-cell w100 tc">
                                                            <a href="javascript:void(0);" data-url="<?php echo url('Form/edit',array('form_id'=>$vo['id'])); ?>" class="eju-event blue" data-type="Form_edit"><?php echo (isset($form_attr_total[$vo['id']]['total']) && ($form_attr_total[$vo['id']]['total'] !== '')?$form_attr_total[$vo['id']]['total']:'0'); ?></a>
                                                        </div>
                                                    </td>
                                                    <td>
                                                        <div class="layui-table-cell w300 tc layadmin-layer-demo right-oper">
                                                            <?php if(is_check_access(CONTROLLER_NAME.'@edit') == '1'): ?>
                                                            <a class="layui-btn btn-edit customvar_edit" data-url="<?php echo url('Form/edit',array('form_id'=>$vo['id'])); ?>" data-type="Form_edit">
                                                            编辑
                                                            </a>
                                                            <?php endif; ?>
                                                            <a class="layui-btn btn-primary" data-url="<?php echo url('Form/label_call',array('form_id'=>$vo['id'])); ?>" data-type="lable_call">
                                                                标签调用
                                                            </a>
                                                            <?php if(is_check_access(CONTROLLER_NAME.'@del') == '1'): ?>
                                                            <a class="layui-btn btn-primary" data-url="<?php echo url('Form/form_del'); ?>" data-id="<?php echo $vo['id']; ?>" data-type="Form_del" >
																删除
                                                            </a>
                                                            <?php endif; ?>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <?php endforeach; endif; else: echo "" ;endif; endif; ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <div class="layui-table-page">
                                    <a class="layui-btn layui-btn-xs" data-type="textAll" id="textAll" data-value="0">全选</a>
                                    <?php if(is_check_access(CONTROLLER_NAME.'@form_del') == '1'): ?>
                                    <a class="layui-btn layui-btn-danger layui-btn-xs " data-type="batch_del" data-url="<?php echo url('Form/form_del'); ?>">
                                    <i class="layui-icon layui-icon-delete"></i>批量删除
                                    </a>
                                    <?php endif; ?>
                                </div>
                                <!--分页-->

                            </div>
                            <?php echo $pageStr; ?>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

    <script>
        layui.config({
        base: '/public/static/admin/' //静态资源所在路径
        ,version: '<?php echo $version; ?>'
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form'], function(){
            var $ = layui.$
                ,element = layui.element
                ,layer = layui.layer
                ,form = layui.form;

            element.render();

            /* 触发事件 */
            var active = {
                textAll: function(){
                    var value = $(this).attr('data-value');
                    if (0 == value) {
                        $(this).attr('data-value', 1).html('取消');
                        $('#checkAll').attr('checked', true);
                        $('input[name*=form_ids]').attr('checked', true);
                    } else {
                        $(this).attr('data-value', 0).html('全选');
                        $('#checkAll').attr('checked', false);
                        $('input[name*=form_ids]').attr('checked', false);
                    }
                    form.render('checkbox');
                }
                ,Form_index: function(){
                    var iframes = layer.open({
                        type: 2,
                        title: '报名内容管理',
                        fixed: true, //不固定
                        shadeClose: false,
                        shade: 0.3,
                        content: $(this).data('url')
                    });
                    layer.full(iframes);
                }
                ,Form_add: function(){
                    var iframes = layer.open({
                        type: 2,
                        title: '新增表单',
                        fixed: true, //不固定
                        shadeClose: false,
                        shade: 0.3,
                        content: $(this).data('url')
                    });
                    layer.full(iframes);
                }
                ,lable_call:function () {
                    layer.open({
                        type: 2,
                        title: '代码调用', shadeClose: true,
                        area: ['90%', '90%'],
                        content: $(this).data('url')
                    });
                }
                ,Form_edit: function(){
                    var iframes = layer.open({
                        type: 2,
                        title: '编辑表单',
                        fixed: true, //不固定
                        shadeClose: false,
                        shade: 0.3,
                        content: $(this).data('url')
                    });
                    layer.full(iframes);
                }
                ,Form_del: function(){
                    delfun(this);
                }
                // 批量删除
                ,batch_del: function(){
                    batch_del(this,'form_ids');
                }
            };
            $('#LAY-component-layer-list .layui-btn,.eju-event').on('click', function(){
                var type = $(this).data('type');
                active[type] && active[type].call(this);
            });

            // 监听复选框全选
            form.on('checkbox(checkAll)', function(data){
                if (data.elem.checked) {
                    $('input[name*=form_ids]').attr('checked', true);
                    $('#textAll').attr('data-value', 1).html('取消');
                } else {
                    $('input[name*=form_ids]').attr('checked', false);
                    $('#textAll').attr('data-value', 0).html('全选');
                }
                form.render('checkbox');
            });

            // 监听每行复选框
            form.on('checkbox(form_ids)', function(data){
                if (data.elem.checked && $('input[name*=form_ids]:checked').length == $('input[name*=form_ids]').length) {
                    $('#checkAll').attr('checked', true);
                    $('#textAll').attr('data-value', 1).html('取消');
                } else {
                    $('#checkAll').attr('checked', false);
                    $('#textAll').attr('data-value', 0).html('全选');
                }
                form.render('checkbox');
            });

            //开启以读
            form.on('switch(is_read)', function(obj){
                var dataid = $(this).attr('data-id');
                if ($(this).val() == 1){
                    $(this).val(0);
                }else{
                    $(this).val(1);
                }
                changeTableVal('form_list','list_id',dataid,'is_read',this);
            });
        });
    </script>

    
</body>
</html>